#{extends 'frame.html' /}
#{set title:'资金管理' /}

#{set 'moreStyles'}
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/money.css'}" />
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/jquery.pagination.css'}" />
#{/set}

#{if user.type.toString()=='SELLER'}
<!-- [卖家]账户押金/金币充值 -->
<div class="tabbedCard" style="min-height:300px">
	<div class="contentTitle">
		金币充值
	</div>
	<div style="margin-left:30px">
		<p style="font-size:16px;font-weight:bold;color:#000;margin-left:20px"> 
			选择支付方式：
			<input type="radio" id="yinhang" name="yinhang" value="0" checked="checked">银行转账
			<input type="radio" id="zhifu" name="yinhang" value="0" style="margin-left:10px">支付宝充值<span style="font-size:12px;color:#ccc">(平台收取0.1%手续费)</span>
		</p>
		<div id="yinhangka">
			<p style="font-size:14px;margin-top:10px">
				银行卡转账 
				<span style="font-weight:bold;color:#000;">（大额转账推荐此方式，免手续费，人工审核对账，非实时，工作时间9:00~22:00约5分钟内处理）</span>
			</p>
			<p style="color:red;margin-top:10px;">
				注意事项：　禁止使用财付通、支付宝转账
			</p>
			<p style="margin-top:10px">
				微赚官方账号：
				<span style="color:#f89d3b">中国农业银行 622848 0018762759175 (户名：施小乐  北京惠新里支行)</span>
			</p>
			<p style="margin-top:10px">
				联系财务QQ确认转账金额：
				<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&amp;uin=177805290&amp;site=qq&amp;menu=yes" class="qq_link"><img style="vertical-align:middle" border="0" src="http://wpa.qq.com/pa?p=2:177805290:51" alt="点击这里给我发消息" title="点击这里给我发消息"></a>
			</p>
		</div>
		<div id="zhifubao" style="display:none">
			<p style="font-size:14px;margin-top:10px">
				支付宝转账 
				<span style="font-weight:bold;color:#000;">（人工审核对账，非实时，工作时间9:00~22:00约5分钟内处理，单笔扣取0.1%手续费。）</span>
			</p>
			<p style="margin-top:10px">
				官方唯一指定支付宝：
				<span style="color:#f89d3b">lezaivip@sina.com  施小乐</span>
			</p>
			<!-- <p style="margin-top:10px">
				<span style="width:100%;float:left">支付宝二维码</span>
				<img style="width:280px;height:400px;margin-left:0px;float:left" src="@{'/public/images/zhifubao_erweima.png'}" />
			</p> -->
		</div>
	</div>
	<!--  
	
	<div class="tabSwitchWrapper">
		<a class="tab-cell chargeTypeTab focus" href="javascript:;" for="pledgeChargePanel">账户押金充值</a>
		<a class="tab-cell chargeTypeTab" href="javascript:;" for="ingotChargePanel">账户金币充值</a>
		<a class="tab-cell chargeTypeTab" href="javascript:;" for="flowChargePanel">账户流量充值</a>
	</div>
	<div class="contentBody clearfix charge-type-panel" id="pledgeChargePanel">
		<div class="clearfix payOrg" id="pledgePaySelBox">
			#{list payPlatforms, as: 'p'}
			<div class="floatLeft panelLine mb10 pay checkTextBtn ${p_isFirst?'selectedCtb':''}">
				<input  class="rad ls floatLeft bank" type="radio" name="pledgePay" value="${p}" ${p_isFirst?'checked':''} />
				<div class="floatLeft ls mt5 bankWidth"><img src="/public/images/bank/${p}.gif" /></div> 
			</div>
			#{/list}
		</div>
		<form id="fm0" method="post" action="/doLogin">
			<div class="inputArea clearfix">
				<div class="panelLine mb10">
					<span class="ls floatLeft">现有账户余额</span>
					<span class="ls floatLeft red bold">${(user.pledge/100).format("##0.00")}</span>
					元
				</div>
				<div class="panelLine mb10">
					<span class="ls floatLeft ">本次充值金额</span>
					<input type="text" class="inputText floatLeft middle mr-8" id="txtChargeVal" value="500" name="ChargeVal" />
					元
					<span class="ls grey">最低1元起充</span>
				</div>

				<div class="buttonSection">
					<a href="javascript:;" class="btnCharge stdColorButton" data-value="PLEDGE">
						确认
						<span class="iconfont">&#xf016d;</span>
					</a>

				</div>
			</div>
		</form>
	</div>
	<div class="contentBody clearfix charge-type-panel" style="display:none" id="ingotChargePanel">
		<div class="clearfix " id="ingotSelBox">
			<div class="panelLine mb10 font1">1.选择套餐</div>
			<div class="clearfix mb10 package-container">
				<div class="floatLeft checkTextBtn selectedCtb" data-value="100">
					<div class="package-box">
						<p class="font1">100金币体验包</p>
						<p class="font2 mb10 bold">100元</p>
					</div>
				</div>
				<div class="floatLeft checkTextBtn" data-value="500">
					<div class="package-box">
						<p class="font1">500金币基本包</p>
						<p class="font2 mb10 bold">500元</p>
					</div>
				</div>
				<div class="floatLeft checkTextBtn" data-value="1000">
					<div class="package-box">
						<p class="font1">1000金币体验包</p>
						<p class="font2 mb10 bold">1000元</p>
					</div>
				</div>
				<div class="ls floatLeft checkTextBtn" data-value="2000">
					<div class="package-box">
						<p class="font1">2000金币体验包</p>
						<p class="font2 mb10 bold">2000元</p>
					</div>
				</div>
			</div>
		</div>
		<div class="panelLine">
			<span class="iconfont mr-4">&#x3434;</span>
			您已经选择购买
			<span class="mr-4 bold"id="ingot">100金币体验包</span>
			<span class="mr-4">需支付:<span class="red bold money">100元</span></span>
		</div>
		<div class="clearfix ">
			<div class="panelLine mb10 font1">2.选择支付方式</div>
			<div class="clearfix payOrg" id="ingotPaySelBox">
				#{list payPlatforms, as: 'p'}
				<div class="floatLeft panelLine mb10 pay checkTextBtn ${p_isFirst?'selectedCtb':''}">
					<input  class="rad ls floatLeft bank" type="radio" name="ingotPay" value="${p}" ${p_isFirst?'checked':''}/>
					<div class="floatLeft ls mt5 bankWidth"><img src="/public/images/bank/${p}.gif" /></div> 
				</div>
				#{/list}
			</div>
		</div>
		<div class="buttonSection">
			<a href="javascript:;" class="btnCharge stdColorButton" data-value="INGOT">
				确认
				<span class="iconfont">&#xf016d;</span>
			</a>

		</div>
		
	</div>
	-->
	<!-- 
	<div class="contentBody clearfix charge-type-panel" style="display:none" id="flowChargePanel">
		<div class="clearfix " id="flowSelBox">
			<div class="panelLine mb10 font1">1.选择套餐</div>
			<div class="clearfix mb10 package-container">
				<div class="floatLeft checkTextBtn selectedCtb" data-value="100">
					<div class="package-box">
						<p class="font1">100金币500流量(1流量/0.2金币)套餐</p>
						<p class="font2 mb10 bold">100 金币</p>
						<p class="font1">500个PC端点击或者166个APP点击</p>
					</div>
				</div>
				<div class="floatLeft checkTextBtn" data-value="200">
					<div class="package-box">
						<p class="font1">200金币1000流量(1流量/0.2金币)套餐</p>
						<p class="font2 mb10 bold">200金币</p>
						<p class="font1">1000个PC端点击或者333个APP点击</p>
					</div>
				</div>
				<div class="floatLeft checkTextBtn" data-value="500">
					<div class="package-box">
						<p class="font1">500金币3333流量(1流量/0.15金币)套餐</p>
						<p class="font2 mb10 bold">500金币</p>
						<p class="font1">3333个PC端点击或者1111个APP点击</p>
					</div>
				</div>
				<div class="ls floatLeft checkTextBtn" data-value="1000">
					<div class="package-box">
						<p class="font1">1000金币10000流量(1流量/0.1金币)套餐</p>
						<p class="font2 mb10 bold">1000金币</p>
						<p class="font1">10000个PC端点击或者3333个APP点击</p>
					</div>
				</div>
				<div class="ls floatLeft checkTextBtn" data-value="5000">
					<div class="package-box">
						<p class="font1">5000金币62500流量(1流量/0.08金币)套餐</p>
						<p class="font2 mb10 bold">5000金币</p>
						<p class="font1">62500个PC端点击或者20833个APP点击</p>
					</div>
				</div>
			</div>
		</div>
		<div class="panelLine">
			<span class="iconfont mr-4">&#x3434;</span>
			您已经选择购买
			<span class="mr-4 bold" id="folw">100金币500流量(1流量/0.2金币)</span>
			<span class="mr-4">需支付:<span class="red bold flowMoney">100元</span></span>
		</div>
		<div class="secondTile">选择支付方式</div>
		<div class="panelBox" id="payType">
			<div class="panelLine sec">
				<input class="rad ls floatLeft ingot " style="margin-top: 10px;" type="checkbox" name="r_pay_type"  /> <span class="floatLeft ls ">
					使用金币支付（可用金币： <span class="red bold ingot seller">${(user?.ingot/100).format("##0.00")}</span>
					个，1个金币价值为1元）
				</span>
			</div>
			<div class="panelLine sec">
				<input class="rad ls floatLeft pledge" style="margin-top: 10px;" type="checkbox" name="r_pay_type" checked="checked" /> <span class="floatLeft ls ">
					使用押金支付（可用押金 <span class="red bold pledge">${(user?.pledge/100).format("##0.00")}</span>
					元）
				</span>
			</div>
		</div>
		<div class="buttonSection">
			<a href="javascript:;" class="btnChargeFlow stdColorButton" id="btnChargeFlow" data-value="FLOW">
				确认
				<span class="iconfont">&#xf016d;</span>
			</a>

		</div>
	</div>
	 -->
</div>
#{/if}

<!--  
#{if user.type.toString()=='BUYER'}
 [买手]账户金币充值 
<div class="contentCard">
	<div class="contentTitle">
		账户金币充值
	</div>
	<div class="card-info">
		<p>
			<span class="iconfont">&#xf0142;</span>
			目前您账户剩余金币<span class="ml10 mr10 blue">${(user.ingot/100)}</span>个， 可接手<span class="ml10 mr10 blue">${Math.round(Math.floor(user.ingot/100))}</span>个任务；如需接手更多任务，请先充值购买金币；购买的金币作为接手任务的押金冻结；任务完成之后会自动解冻。
		</p>
	</div>
	<div class="contentBody clearfix">
		<div class="clearfix" id="ingotSelBox">
			<div class="panelLine mb10 font1">1.选择套餐</div>
			<div class="clearfix mb10 package-container">
				<div class="floatLeft checkTextBtn selectedCtb" data-value="10">
					<div class="package-box">
						<p class="font1">10金币迷你包</p>
						<p class="font2 mb10 bold">10元</p>
					</div>
				</div>
				<div class="floatLeft checkTextBtn" data-value="20">
					<div class="package-box">
						<p class="font1">20金币标准包</p>
						<p class="font2 mb10 bold">20元</p>
					</div>
				</div>
				<div class="floatLeft checkTextBtn" data-value="40">
					<div class="package-box">
						<p class="font1">40金币高级包</p>
						<p class="font2 mb10 bold">40元</p>
					</div>
				</div>
				<div class="ls floatLeft checkTextBtn" data-value="100">
					<div class="package-box">
						<p class="font1">100金币豪华包</p>
						<p class="font2 mb10 bold">100元</p>
					</div>
				</div>
			</div>
		</div>
		<div class="panelLine mb20">
			<span class="iconfont mr-4">&#x3434;</span>
			您已经选择购买
			<span class="mr-4 bold"id="ingot">10金币体验包</span>
			<span class="mr-4">需支付:<span class="red bold money">10元</span></span>
		</div>
		<div class="clearfix " >
			<div class="panelLine mb10 font1">2.选择支付方式</div>
			<div class="clearfix payOrg" id="ingotPaySelBox">
				#{list payPlatforms, as: 'p'}
				<div class="floatLeft panelLine mb10 pay checkTextBtn ${p_isFirst?'selectedCtb':''}">
					<input  class="rad ls floatLeft mt10 bank" type="radio" name="ingotPay" value="${p}" ${p_isFirst?'checked':''}/>
					<div class=" floatLeft ls mt5 bankWidth"><img src="/public/images/bank/${p}.gif" /></div> 
				</div>
				#{/list}
			</div>
		</div>
		<div class="buttonSection">
			<a href="javascript:;" class="btnCharge stdColorButton" data-value="INGOT">
				确认
				<span class="iconfont">&#xf016d;</span>
			</a>
		</div>
	</div>
</div>
#{/if}
-->
<div class="tabbedCard">
	<div class="contentTitle">
		资金记录
	</div>
	<div class="tabSwitchWrapper">
		<a class="tab-cell fundTab focus" href="javascript:;" type="withdraw">提现记录</a>
		<a class="tab-cell fundTab" href="javascript:;" type="ingot">金币记录</a>
		#{if user?.isBuyer()}
		<a class="tab-cell fundTab" href="javascript:;" type="deposit">本金记录</a>
		<a class="tab-cell fundTab" href="javascript:;" type="premium" isReward="true">佣金记录</a>
		#{/if}
		#{if user?.isSeller()}
		<a class="tab-cell fundTab" href="javascript:;" type="pledge">押金记录</a>
		<a class="tab-cell fundTab" href="javascript:;" type="flow">流量记录</a>
		#{/if}
		<a class="tab-cell fundTab" href="javascript:;" type="member">会员记录</a>
	</div>

	<div class="contentBody">
		<div class="fundRecordWrapper" style="overflow: hidden;" id="recordContainer">
		</div>
		<!--这里是分页区域-->
		<div class="popWrapper" style="display:none;" id="tr_loading_mask">
			<div class="maskLayer"></div>
			<img class="tr_juhua" src="@{'/public/images/pre_loading.gif'}" />
		</div>
		<div class="pagin-btm clearFix">
			<div class="pagination"></div>
		</div>

	</div>
</div>

<textarea id="withdrawRecordTemp" class="muban">
	<table class="normTable">
		<thead>
			<tr>
				<td width="25%">申请时间</td>
				<td width="10%">金额</td>
				<td width="10%">状态</td>
				<td>交易信息</td>
				<td></td>
			</tr>
		</thead>
		<tbody>
			{{#results}}
			<tr>
				<td>{{applyTimeStr}}</td>
				<td>{{amountStr}}元</td>
				<td>{{statusStr}}</td>
				<td>{{tradeNo}}</td>
				<td>
					{{#isBuyerDeposit}}
					<a class="J_viewBuyerTask ml20 grey" href="javascript:;" data-id="{{id}}">
						查看任务
						<span class="iconfont f12 showtask" style="padding-left:4px;">&#xf0170;</span>
					</a>
					{{/isBuyerDeposit}}
				</td>
			</tr>
			<tr style="display:none">
			<td colspan="5" >
					<div class="task-info" ></div>
				</td>
			</tr>
			{{/results}}
		</tbody>
	</table>
</textarea>
<textarea id="memberRecordTemp" class="muban">
	<table class="normTable">
		<thead>
			<tr>
				<td width="20%">时间</td>
				<td width="10%">金额</td>
				<td width="25%">金币数</td>
				<td>备注</td>
			</tr>
		</thead>
		<tbody>
			{{#results}}
			<tr>
				<td>{{createTimeStr}}</td>
				<td>{{amountStr}}元</td>
				<td>{{ignotStr}}个</td>
				<td>{{memo}}</td>
			</tr>
			{{/results}}
		</tbody>
	</table>
</textarea>
<textarea id="pledgeRecordTemp" class="muban">
	<table class="normTable">
		<thead>
			<tr>
				<td width="20%">时间</td>
				<td width="10%">收入</td>
				<td width="10%">支出</td>
				<td width="10%">结余</td>
				<td>备注</td>
			</tr>
		</thead>
		<tbody>
			{{#results}}
			<tr>
				<td>{{createTimeStr}}</td>
				<td>{{plusAmountStr}}</td>
				<td>{{minusAmountStr}}</td>
				<td>{{balanceStr}}元</td>
				<td>{{memo}}</td>
			</tr>
			{{/results}}
		</tbody>
	</table>
</textarea>
<textarea id="flowRecordTemp" class="muban">
	<table class="normTable">
		<thead>
			<tr>
				<td width="20%">时间</td>
				<td width="10%">收入</td>
				<td width="10%">支出</td>
				<td width="10%">结余</td>
				<td>备注</td>
			</tr>
		</thead>
		<tbody>
			{{#results}}
			<tr>
				<td>{{createTimeStr}}</td>
				<td>{{plusAmountStr}}</td>
				<td>{{minusAmountStr}}</td>
				<td>{{balanceStr}}</td>
				<td>{{memo}}</td>
			</tr>
			{{/results}}
		</tbody>
	</table>
</textarea>

<textarea id="taskCellTemp" class="muban">
	{{#results}}
	<div class="taskCell">
		<div class="title">
			<span class="taskNo floatRight">
				任务编号：{{buyerTaskNo}}
				<a target="_blank" href="/buyer/task/{{id}}" class="view-detail">[查看详情]</a>
			</span>
			<span class="shop floatLeft"> <i class="plat_small {{platIcon}}"></i>
				{{shopName}}
			</span>
			
		</div>
		<div class="body">
			<table class="normTable">
				<tbody>
					<tr>
						<td class="item-list">
							<div class="item-box">
								<div class="pic">
									<img src="{{itemPic}}" />
								</div>
								<div class="item-title mt20 ml20 floatLeft">
								    {{itemTitle}}
								</div>
							</div>

						</td>
						<td class="nick"> 
							{{buyerAccountNick}}
						</td>
						<td class="price"> 
							{{paidFeeStr}}元
						</td>
						<td class="status">
							{{Time}}
						</td>
					</tr>
				</tbody>

			</table>

		</div>
	</div>
	{{/results}}
</textarea>

<!-- 银行支付弹出模态窗口 -->
<div class="popWrapper bankPayment" id="bankPayment">
	<div class="maskLayer"></div>
	<div class="modalWnd">
		<a href="javascript:void(0);" class="wnd_Close_Icon" id="modifyclose" title="关闭窗口"></a>
		<h3 class="topTile">请到打开的新窗口进行银行卡支付：</h3>
		<div class="modalWndInner">
			<hr size="1" color="black" noshade="noshade" />
			<div id="bankInfoShower">
				<div class="panelLine">
					<p>支付小贴士：</p>
				</div>
				<div class="panelLine">
					<p>1. 付款未完成前请不要关闭本页面，您在银行端完成付款后本页面会自动刷新。</p>
				</div>
				<div style="margin-bottom:20px;">
					<p>2. 如果银行页面没有打开，请您设置您的浏览器为允许弹出，并确保已经安装了银行的 ActiveX 安全控件， 然后点击下面的“返回支付页面，重新选择”按钮，重新支付。
					</p>
				</div>
			</div>
			<div class="wndBotButtonSection">
				<a id="btnbankpay" href="javascript:;" class="botButton btnConfirmSave">已完成付款</a>
				<a href="javascript:;" class="return" id="btnpayerror">返回重新选择付款方式</a>
			</div>
		</div>
	</div>
</div>

#{set 'moreScripts'}
<script src="@{'/public/javascripts/mustache.min.js'}" type="text/javascript"></script>
<script src="@{'/public/javascripts/jquery.number.min.js'}" type="text/javascript"></script>
<script src="@{'/public/javascripts/jquery.pagination.js'}" type="text/javascript"></script>
<script src="@{'/public/javascripts/money.js'}" type="text/javascript"></script>
<script type="text/javascript">
	App.module = 'money';
	App.userType = '${user?.type}';
	$(function(){
		$("input[id=yinhang]").click(function(){
			$("#yinhangka").show();
			$("#zhifubao").hide();
		})
		$("input[id=zhifu]").click(function(){
			$("#yinhangka").hide();
			$("#zhifubao").show();
		})
	})
</script>
#{/set}